local Util = require("common.Util")
local CombatLogic = require("combat.CombatLogic")
local CombatPosLogic = require("combat.CombatPosLogic")
local CombatDefine = require("combat.CombatDefine")
local CombatVideo = require("combat.CombatVideo")
local JjcLogic = require("jjc.JjcLogic")
local JibanLogic = require("combat.JibanLogic")
local Lang  = require("common.Lang")
local Broadcast = require("broadcast.Broadcast")
local Msg = require("core.Msg")

--阵法 begin
function CG_COMBAT_POS_QUERY(human,msg)
	CombatPosLogic.posQuery(human,msg.type,msg.groupID, msg.param, 1)
end

function CG_COMBAT_POS_UPDATE(human,msg)
	CombatPosLogic.updatePos(human,msg)
end

function CG_COMBAT_FORMATION_QUERY(human)
	CombatPosLogic.formationQuery(human)
end 

function CG_COMBAT_POS_ATTR_QUERY(human)
	CombatPosLogic.posAttrQuery(human)
end

--阵法 end
function CG_COMBAT_SET_QUICK(human, msg)
	CombatPosLogic.setQuick(human, msg.combatType, msg.isQuick)
end

function CG_COMBAT_BEGIN(human, msg)
	CombatLogic.tryCombatBegin(human, msg.combatType, msg.param)
end

function CG_COMBAT_SPEED(human, msg)
	human.db.combatSpeed = msg.speed
    local msgRet = Msg.gc.GC_COMBAT_SPEED
    msgRet.speed = msg.speed
    Msg.send(msgRet,human.fd)
end

function CG_COMBAT_VIDEO_QUERY(human)
	CombatVideo.sendCombatVideoQuery(human)
end

function CG_COMBAT_SAVE_VIDEO(human)
	CombatVideo.saveCombatVideo(human, false)
end

function CG_COMBAT_DEL_VIDEO(human, msg)
	CombatVideo.deleteCombatVideo(human, msg.videoUuid)
end

function CG_COMBAT_LOOK_VIDEO(human, msg)
	CombatVideo.lookCombatVideo(human, msg.videoUuid, msg.lookType)
end

function CG_COMBAT_CLIENT_FINISH(human, msg)
	CombatLogic.clientFinish(human, msg.type)
end

function CG_COMBAT_CLIENT_PASS_TIME(human, msg)
	CombatLogic.clientPassTime(human, msg.type, msg.passTime)
end

function CG_JIBAN_QUERY(human,msg)
	JibanLogic.query(human,msg.combatType,msg.heroID)
end

function CG_JIBAN_PREVIEW(human,msg)
	JibanLogic.preview(human)
end

function CG_JIBAN_UPDATE(human,msg)
	JibanLogic.update(human,msg.combatType,msg.jibanList)
end

function CG_HERO_UPDATE_ALL_POS(human,msg)
   CombatPosLogic.updateAllPos(human,msg.uuid)
end

function CG_HERO_UPDATE_ZDL(human,msg)
	CombatPosLogic.updateZdl(human,msg.uuid)
end